from langchain_openai import ChatOpenAI
from langchain_community.chat_message_histories import ChatMessageHistory

api_key = "sk-6S0PtpNia71gjcfwSsDPsJ9mGqsVPr2XRQzAx1dHbJS7RW4t"
api_base="https://chatapi.littlewheat.com/v1"

llm = ChatOpenAI(model="gpt-3.5-turbo",api_key=api_key ,base_url=api_base)

history = ChatMessageHistory()
history.add_user_message("你好，请你介绍一下你自己")

history.add_ai_message("我是一个无所不能的小智？")
history.add_user_message("什么是AIGC学习计划？")
#print(history)
response=llm.invoke(history.messages)
print(response)
print(ChatMessageHistory)